// import './assets/main.css'

import { createApp } from 'vue'
import App from './App.vue'
import router from './router'

import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

import { createPinia } from 'pinia'
// import piniaPersist from  'pinia-plugin-persist'; // 导入插件
import { createPersistedState } from 'pinia-plugin-persistedstate'

const app = createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
// 创建pinia 实例
const pinia = createPinia()
pinia.use(
  createPersistedState({
    // 所有 Store 都开启持久化存储
    auto: true
  })
)

app.use(pinia)
app.use(router)
app.use(ElementPlus)
app.mount('#app')